//
//  MDHMacro.h
//  MDHPT
//
//  Created by 高得华 on 2019/9/28.
//  Copyright © 2019 高得华. All rights reserved.
//

#ifndef MDHMacro_h
#define MDHMacro_h

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "RACEXTScope.h"

//MARK: - ==== 宏定义 =======
// 项目打包上线都不会打印日志，因此可放心。
#ifdef DEBUG
#define DTLog(s, ... ) NSLog( @"[%@ in line %d] =====%@=====>%@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithUTF8String:object_getClassName(self)], [NSString stringWithFormat:(s), ##__VA_ARGS__] )//NSLog( @"[%@ in line %d] ===============>%@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DTLog(s, ... )
#endif


//MARK: - ===== Block
///------
typedef void (^VoidBlock)(void);
typedef BOOL (^BoolBlock)(void);
typedef int  (^IntBlock) (void);
typedef id   (^IDBlock)  (void);

typedef void (^VoidBlock_int)(int);
typedef BOOL (^BoolBlock_int)(int);
typedef int  (^IntBlock_int) (int);
typedef id   (^IDBlock_int)  (int);

typedef void (^VoidBlock_string)(NSString *);
typedef BOOL (^BoolBlock_string)(NSString *);
typedef int  (^IntBlock_string) (NSString *);
typedef id   (^IDBlock_string)  (NSString *);

typedef void (^VoidBlock_id)(id);
typedef BOOL (^BoolBlock_id)(id);
typedef int  (^IntBlock_id) (id);
typedef id   (^IDBlock_id)  (id);


/// 微信项目重要数据备份的文件夹名称（Documents/WeChatDoc）利用NSFileManager来访问
static NSString * const MDHPT_MMW_DOC_NAME = @"MDHPT_MMWDoc";
/// 微信项目轻量数据数据备份的文件夹（Library/Caches/WeChatCache）利用NSFileManager来访问
static NSString * const MDHPT_MMW_CACHE_NAME = @"MDHPT_MMWCache";

///返回按钮的图片 名称 common_nav_btn_back
static NSString * _Nullable const kCommonNavButtonBack = @"common_nav_btn_back";


///屏幕宽度
static inline CGFloat kMDH_SCREEN_WIDTH() {
    return [[UIScreen mainScreen] bounds].size.width;
}
///屏幕高度
static inline CGFloat kMDH_SCREEN_HEIGHT() {
    return [[UIScreen mainScreen] bounds].size.height;
}
///屏幕适配尺寸 适配
static inline CGFloat kMDHPTAutoScale() {
    return kMDH_SCREEN_WIDTH()/375.f;
}
static inline CGFloat MDHPxConvertToPt(CGFloat px){
    return ceil(px * kMDHPTAutoScale());
}

#endif /* MDHMacro_h */
